package com.ficus.road.maintain.strategy.operationlog;

import com.ficus.road.maintain.core.model.OperationLog;

/**
 * @author xiawen yang
 * @date 2021/12/24 上午10:50
 */
public class OperationLogContext {
    private OperationLogStrategy strategy;

    public OperationLogContext(String type) {
        if ("推送中海".equals(type)) {
            strategy = new PushZHStrategy();
        } else if ("中海回调".equals(type)) {
            strategy = new ZHCallbackStrategy();
        } else if ("复核病害".equals(type)) {
            strategy = new HitRecheckStrategy();
        } else {
            strategy = new PushCJYHStrategy();
        }
    }

    public OperationLogContext(OperationLogStrategy strategy) {
        this.strategy = strategy;
    }

    public Object processRequestParam(String paramsString) {
        return strategy.processRequestParam(paramsString);
    }

    public Object processResponse(String returnString, OperationLog operationLog) {
        return strategy.processResponse(returnString, operationLog);
    }
}
